
<div class="page" ng-controller="inquiryAddController">
    <div class="page-head">
        <h1 class="font-thin h4">{{inquiryName}}</h1>
    </div>
    <div class="page-body" id="inquiryAddDetail">
        <form name="orderForm" id="inquiryForm" class="form-validation form-horizontal" novalidate>
            <ng-form name="inquiryForms" >
                <div class="page-body-banner">
                    <div class="banner-item-text">
                        <label class="pull-left banner-text ">计划专员:</label>
                        <label class="banner-text">{{plannerName}}</label>
                    </div>
                    <div class="banner-item">
                        <label class="pull-left  banner-label"><span class="text-danger">*&nbsp;</span>商务专员：</label>
                        <select class="form-control  banner-ipt tms-select" id="inquiryAdd_businessOfficerId" ng-model="businessOfficerId" name="businessOfficerId" ng-options="x.id as x.realName for x in businessOfficerDropDown" ng-disabled="editInquiryDis || isInquiryDis" required>
                            <option value="">请选择</option>
                        </select>
                    </div>
                    <div class="banner-item">
                        <label class="pull-left  banner-label "><span class="text-danger">*&nbsp;</span>客服专员：</label>
                        <select class="form-control  banner-ipt tms-select" id="inquiryAdd_customerServiceOfficerId" ng-model="customerServiceOfficerId" name="customerServiceOfficerId" ng-options="x.id as x.realName for x in serviceOfficerIdDropDown" ng-disabled="editInquiryDis || isInquiryDis" required>
                            <option value="">请选择</option>
                        </select>
                    </div>
                    <div class="banner-item">
                        <label class="pull-left  banner-label"><span class="text-danger">*&nbsp;</span>调度专员：</label>
                        <select class="form-control banner-ipt tms-select" id="inquiryAdd_dispatchOfficerId" ng-model="dispatchOfficerId" name="dispatchOfficerId" ng-options="x.id as x.realName for x in dispatchOfficerDropDown" ng-disabled="editInquiryDis || isInquiryDis" required>
                            <option value="">请选择</option>
                        </select>
                        
                    </div>
                    <div class="banner-item banner-item-right">
                        <input id="inquiryAdd_urgency" name="urgency" type="text" class="form-control tms-ipt input-sm tms-inline banner-urgengcy-num" ng-model="urgency" placeholder="紧急度" ng-disabled="editInquiryDis || isInquiryDis" required>
                        <select id="inquiryAdd_urgencyUnit" class="form-control  banner-urgency-unit tms-select" ng-model="urgencyUnit" name="urgencyUnit" ng-options="x.value as x.text for x in urgencyUnitDropDown" ng-disabled="editInquiryDis || isInquiryDis" required>
                            <option value="">请选择</option>
                        </select>
                        <label class="banner-text">内回复</label>
                    </div>

                    <!-- <div class="banner-item banner-item-right">
                        <label class="banner-text">{{urgency}}</label>
                        <select class="form-control banner-urgency-unit tms-select" ng-model="urgencyUnit" name="urgencyUnit" ng-options="x.value as x.text for x in urgencyUnitDropDown" disabled="disabled" required id="urgencyUnit">
                            <option value="">请选择</option>
                        </select>
                        <label class="banner-text">内回复</label>
                    </div> -->

                </div>

                <div class="detail-block">
                    <div class="block-head">基本信息</div>
                    <table class="table-bordered detail-table">
                        <tr>
                            <td class="detail-td-left">总询价单编号 ：</td>
                            <td class="detail-td-right">
                                <label class=" text-left">{{inquiryId}}</label>
                            </td>
                        </tr>
                        <tr>
                            <td class="detail-td-left"><span class="text-danger">*&nbsp;</span>客户单位 ：</td>
                            <td class="detail-td-right">
                                
                                <div class="ipt-3" angucomplete-alt id="client" placeholder="" pause="100" selected-object="clientSelect" remote-api-handler="searchClient" search-fields="name" title-field="name" minlength="1" input-class="form-control form-control-small input-sm" initial-value="clientName"
                                    name="clientName" match-class="highlight" disable-input="editInquiryDis || isInquiryDis" field-required="true">
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td class="detail-td-left"><span class="text-danger">*&nbsp;</span>发货计划人 ：</td>
                            <td class="detail-td-right">
                                <div class="ipt-3" angucomplete-alt id="consignor" placeholder="" pause="100" selected-object="consignorSelect" remote-api-handler="searchConsignor" search-fields="realName" title-field="realName" minlength="1" input-class="form-control form-control-small input-sm"
                                    initial-value="consignorName" name="consignorName" match-class="highlight" disable-input="editInquiryDis || isInquiryDis" field-required="true">
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td class="detail-td-left"><span class="text-danger">*&nbsp;</span>发货人电话 ：</td>
                            <td class="detail-td-right">
                                
                                <label>{{consignorPhone}}</label>
                                <!-- <input id="inquiryAdd_consignorPhone" name="consignorPhone" type="text" class="form-control input-sm" ng-model="consignorPhone" placeholder="请填写发货人电话" required disabled="disabled"> -->
                            </td>
                        </tr>
                        <tr>
                            <td class="detail-td-left">总询价内容 ：</td>
                            <td class="detail-td-right td-textarea-container">
                                <textarea class="form-control input-sm detail-text-area " ng-model="content" placeholder="请填写总询价内容" ng-disabled="editInquiryDis || isInquiryDis" name="content"></textarea>
                            </td>
                        </tr>
                    </table>
                </div>

                <div class="detail-block">
                    <div class="block-head">线路信息</div>
                    <table class="table-bordered detail-table">
                            <tr>
                                <td class="detail-td-left"><span class="text-danger">*&nbsp;</span>发货地址 ：</td>
                                <td class="detail-td-right">
                                    
                                    <tms-address class="pull-left" city-list="shipCityList" area-list="shipAreaList" province="startProvince" city="startCity" area="startArea" required="true" ischecked="ischecked">
                                    </tms-address>
                                    <input id="page_inquiry_add_startAddress" name="startAddress" type="text" class="form-control input-sm tms-ipt ipt-4"  ng-model="startAddress" placeholder="请填写详细地址" required>
                                </td>
                            </tr>
                            <tr>
                                <td class="detail-td-left"><span class="text-danger">*&nbsp;</span>送货地址 ：</td>
                                <td class="detail-td-right">
                                    
                                    <tms-address class="pull-left" city-list="deliverCityList" area-list="deliverAreaList" province="endProvince" city="endCity" area="endArea" ischecked="ischecked" required="true">
                                    </tms-address>
                                    <input id="inquiryAdd_endAddress" name="endAddress" type="text" class="form-control input-sm tms-ipt ipt-4" ng-model="endAddress" placeholder="请填写详细地址" required name="endAddress">
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2"   >
                                    <div class="td-multi-col ">
                                        <div class="td-flex flex-1">
                                            <span class="td-title td-title-first"><span class="text-danger">*&nbsp;</span>预计发货时间 ：</span>
                                            <span class="td-content">
                                                <input id="dataTime" name="plannedArrivalTime" datetimepicker plugintype="datetime" ng-model="plannedArrivalTime" placeholder="预计发货时间" class="form-control tms-ipt ipt-6 ipt-time" type="text" required />
                                            </span>
                                        </div>
                                        <div class="td-flex flex-1">
                                            <span class="td-title"><span class="text-danger">*&nbsp;</span>预计到货时间 ：</span>
                                            <span class="td-content">
                                                    <input id="dataTimeEnd" name="plannedDeliveryTime" datetimepicker plugintype="datetime" ng-model="plannedDeliveryTime" placeholder="预计到货时间" class="form-control tms-ipt ipt-6 ipt-time" type="text" required />
                                            </span>
                                        </div>
                                        <div class="td-flex flex-2">
                                            <span class="td-title">里程数 ：</span>
                                            <span class="td-content">
                                                
                                                <input id="inquiryAdd_mileage" name="mileage" type="text" class="form-control input-sm tms-ipt ipt-3" ng-model="mileage" ng-pattern="/^[+]?\d+\.?\d*$/" placeholder="请填写里程数">
                                                <label class="control-label">公里</label>
                                            </span>
                                        </div>
                                    </div>
                                    
                                </td>
                                
                            </tr>
                            
                        </table>
                </div>

                <div class="detail-block">
                    <div class="block-head">货物信息</div>
                    <table class="table-bordered detail-table">
                        <tr>
                            <td>
                                <div class="td-multi-col ">
                                    <div class="td-flex flex-1">
                                        <span class="td-title td-title-first"><span class="text-danger">*&nbsp;</span>货物类别 ：</span>
                                        <span class="td-content">
                                            <select id="inquiryAdd_goodsTypeName" class="form-control input-sm tms-inline tms-select ipt-6" ng-model="goodsTypeId" name="goodsTypeId" ng-change="goodsTypeSelect()" ng-options="x.id as x.name for x in goodsTypeDropDown" required>
                                                <option value="">请选择</option>
                                            </select>
                                        </span>
                                    </div>
                                    <div class="td-flex flex-1">
                                        <span class="td-title"><span class="text-danger">*&nbsp;</span>货物名称 ：</span>
                                        <span class="td-content">
                                            
                                            <div class="tms-inline tms-autocomplete ipt-6" angucomplete-alt id="goodsId" placeholder="" pause="100" selected-object="onGoodsNameSelected" remote-api-handler="onGoodsNameAutoComplate" search-fields="name" title-field="name" minlength="0" input-class="form-control form-control-small input-sm"
                                                initial-value="goodsName" match-class="highlight" field-required="true" input-name="goodsId" auto-match="true" focus-first="true">
                                            </div>
                                        </span>
                                    </div>
                                    <div class="td-flex flex-2">
                                        <span class="td-title"><span class="text-danger">*&nbsp;</span>货物数量 ：</span>
                                        <span class="td-content">
                                            <input id="inquiryAdd_goodsQuantity" name="goodsQuantity" type="text" ng-pattern="/^[0-9]+(\.[0-9]{1,4})?$/" class="form-control input-sm  tms-inline ipt-2" id="goodsQuantity" ng-model="goodsQuantity" placeholder="数量" required>
                                            <select class="form-control input-sm tms-inline tms-select ipt-2-1" id="inquiryAdd_goodsQuantityUnit" ng-model="goodsQuantityUnit" name="goodsQuantityUnit" ng-options="x.value as x.text for x in goodsQuantityUnitDropDown" required>
                                                <option value="">请选择</option>
                                            </select>
                                        </span>
                                    </div>
                                </div>
                            </td>
                            
                        </tr>
                        
                        
                    </table>
                </div>
                <div class="detail-block">
                    <div class="block-head">所需车辆信息</div>
                    <table class="table-bordered detail-table">
                        <tr>
                            <td>
                                <div class="td-multi-col ">
                                    <div class="td-flex flex-1">
                                        <span class="td-title td-title-first"><span class="text-danger">*&nbsp;</span>所需车辆 ：</span>
                                        <span class="td-content">
                                            <select id="inquiryAdd_carType" class="form-control input-sm tms-inline tms-select ipt-6" ng-model="carType" name="carType" ng-options="x.value as x.text for x in carTypeDropDown" required>
                                                <option value="">请选择</option>
                                            </select>
                                        </span>
                                    </div>
                                    <div class="td-flex flex-1">
                                        <span class="td-title"><span class="text-danger">*&nbsp;</span>所需车长 ：</span>
                                        <span class="td-content">
                                            <select id="inquiryAdd_carLength" class="form-control input-sm  tms-inline tms-select ipt-6" ng-model="carLength" name="carLength" ng-options="x.value as x.text for x in carLengthDropDown" required>
                                                <option value="">请选择</option>
                                            </select>
                                        </span>
                                    </div>
                                    <div class="td-flex flex-1">
                                        <span class="td-title"><span class="text-danger">*&nbsp;</span>承运方式 ：</span>
                                        <span class="td-content">
                                            <select id="inquiryAdd_carrierCategory" class="form-control input-sm  tms-inline tms-select ipt-6" ng-model="carrierCategory" name="carrierCategory" ng-options="x.value as x.text for x in carrierCategoryDropDown" required>
                                                <option value="">请选择</option>
                                            </select>
                                        </span>
                                    </div>
                                    <div class="td-flex flex-1">
                                        <span class="td-title">装车效果 ：</span>
                                        <span class="td-content">
                                            <input id="inquiryAdd_loadingEffect" name="loadingEffect" type="text" class="form-control input-sm   tms-inline ipt-6" ng-model="loadingEffect" placeholder="请填写装车效果">
                                        </span>
                                    </div>
                                </div>
                            </td>
                            
                        </tr>
                        
                        
                    </table>
                </div>
                <div class="detail-block">
                    <div class="block-head">附件信息</div>
                    <table class="table-bordered detail-table">
                        <tr>
                            <td class="detail-td-left">附件上传 ：</td>
                            <td class="detail-td-right">    

                                <input class="tms-ipt-file" id="inquiryAdd_attachmentUploader" name="inquiryAdd_attachmentUploader" type="file" file-read uploader="attachmentUploader" multiple />
                                <button class="btn tms-btn tms-btn-select-file" onClick="inquiryAdd_attachmentUploader.click()">选择文件</button>
                                <button id="inquiryAdd_uploadAll" class="btn tms-btn tms-btn-uploadAll" ng-click="attachmentUploader.uploadAll()"  ng-disabled="!attachmentUploader.getNotUploadedItems().length">
                                        <!-- ng-if="!editInquiryDis"老版本的 -->
                                        全部上传
                                </button>
                            </td>
                        </tr>
                        <tr>
                            <!-- 没有了上传文件数 -->
                            <td class="detail-td-left"></td>
                            <td class="detail-td-right detail-attachment-container">
                                <table class="table-bordered detail-attachment-table table-tables" ng-if="attachmentUploader.queue.length">
                                    <thead class="table-thea">
                                        <tr>
                                            <th width="20%">名称</th>
                                            <th width="20%">大小</th>
                                            <th width="20%">进度</th>
                                            <th width="20%">状态</th>
                                            <th>操作</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr ng-repeat="item in attachmentUploader.queue">
                                            <td class="attachment-table-filename">
                                                <strong>{{item.fileName|| item.fileName }}</strong>
                                            </td>
                                            <td class="text-center" nowrap>{{ item.fileSize/1024/1024|number:2 }} MB</td>
                                            <td class="text-center">
                                                <div class="progress" style="margin: 0 auto; width:60px;">
                                                    <div class="progress-bar" role="progressbar" ng-style="{ 'width': item.progress + '%' }"></div>
                                                </div>
                                            </td>
                                            <td class="text-center">
                                                <span ng-show="item.isSuccess"><i class="glyphicon glyphicon-ok"></i></span>
                                                <span ng-show="item.isCancel"><i class="glyphicon glyphicon-ban-circle"></i></span>
                                                <span ng-show="item.isError"><i class="glyphicon glyphicon-remove"></i></span>
                                            </td>
                                            <td class="text-center" nowrap>
                                                <button id="inquiryAdd_upload" class="btn tms-attachemnt-btn attachment-btn-upload" ng-click="attachmentUploader.upload(item)" ng-disabled="item.isReady || item.isUploading || item.isSuccess">
                                                    上传
                                                </button>
                                                <button id="inquiryAdd_onDelete" class="btn tms-attachemnt-btn attachment-btn-delete" ng-click="[attachmentUploader.onDelete(item)]">
                                                    删除
                                                </button>
                                                
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </td>
                        </tr> 

                        <tr>
                            <td class="detail-td-left">
                                备注：
                            </td>
                            <td class="detail-td-right td-textarea-container">
                                <textarea class="form-control  detail-text-area " ng-disabled="editInquiryDis" ng-model="attachmentDetails" placeholder="请填写备注" name="attachmentDetails"></textarea>
                            </td>                            
                        </tr>

                    </table>
                </div>

                <div class="detail-block" ng-show="remarksShow">
                    <div class="block-head">备注信息</div>
                    <table class="table-bordered detail-table detail-remarks">
                        

                        <tr>
                            <td class="detail-td-left">
                                备注：
                            </td>
                            <td class="detail-td-right td-textarea-container">
                                <textarea class="form-control detail-text-area" ng-model="remarks" placeholder="请填写备注" name="remarks"></textarea>
                            </td>
                        </tr>
                        
                        
                    </table>
                </div>
                <div class="detail-block"  ng-show="inquiryChildShow">
                    <div class="block-head">
                        <span class="block-head-span">子询价单列表 </span>
                        <span class="block-head-span detail-btnAdd">
                            <button id="inquiryAdd_addChild" class="btn detail-block-btn detailBtn-add"  ng-click="addInquiryChild()"><i class="fa fa-plus-circle"></i>&nbsp;&nbsp;新增</button>
                        </span>
                        
                    </div>
                    <!-- <div class="block-head-btn">
                            <button id="inquiryAdd_addChild" class="btn detail-block-btn" ng-show="inquiryChildShow" ng-disabled="!inquiryForms.$valid" ng-click="addInquiryChild()"><i class="fa fa-plus"></i>新增</button>
                    </div> -->
                    <table class="table-bordered detail-table table-center">
                        <thead class="table-thea table-tables">
                            <tr>
                                <th width="5%">操作</th>
                                <th width="9%">发货地址</th>
                                <th width="9%">送货地址</th>
                                <th width="9%">货物名称</th>
                                <th width="9%">货物数量</th>
                                <th width="9%">预计发货时间</th>
                                <th width="9%">预计到货时间</th>
                                <th width="9%">所需车型</th>
                                <th width="9%">所需车长</th>
                                
                            </tr>
                        </thead>
                        <tbody class="tab-tbod">
                            <tr ng-repeat="item in inquiryChildViewList" title="{{item.shipAddress}}  {{item.deliveryAddress}}  {{item.goodsName}}  {{item.goodsNum + item.goodsQuantity}}{{item.plannedArrivalTime}}  {{item.plannedDeliveryTime}}  {{item.carType}}  {{item.carLength}}">
                                <td>
                                    <!-- <a data-toggle="modal" title="删除" data-target="#lineprice" class="fa fa-trash-o m-l-xs primary text-info" ng-click="delInquiryChild(item.index,item.entity)"></a>  新版本的-->
                                    <a  class=" m-l-xs primary text-in-table" ng-click="delInquiryChild(item.index,item.entity)">删除</a>
                                </td>
                                <td>{{item.shipAddress}}</td>
                                <td>{{item.deliveryAddress}}</td>
                                <td>{{item.goodsName}}</td>
                                <td>{{item.goodsQuantity}}</td>
                                <td>{{item.plannedArrivalTime}}</td>
                                <td>{{item.plannedDeliveryTime}}</td>
                                <td>{{item.carType}}</td>
                                <td>{{item.carLength}}</td>
                                
                            </tr>
                        </tbody>
                        
                        
                    </table>
                </div>

                <div class="detail-btn-area text-center detail-bottom">
                    <button id="inquiryAdd_release" class="btn tms-btn tms-btn-release" ng-disabled="saveDis" ng-click="inquirySave()">询价发布</button>
                    <button id="inquiryAdd_cancel" ui-sref="app.inquiry.inquiryListNew({name:'inquiryNew'})" class="btn tms-btn tms-btn-back ">返回</button>
                </div>


            </ng-form>
        </form>
    </div>
</div>
